<template>
  <div>
    <!-- 收藏页面头部 -->
    <van-nav-bar
      title="收藏列表"
      left-arrow
    >
      <template #left>
        <van-icon  name="arrow-left" @click="$router.back()"/>
      </template>
    </van-nav-bar>
    <!-- 每一列收藏数据 -->
    <card-list :obj="item" v-for="item in list" :key="item.houseCode"></card-list>
  </div>
</template>

<script>
// import { favoriates } from '@/api/user'
import { createNamespacedHelpers } from 'vuex'
import CardList from '../../components/CardList.vue'
const { mapActions: mapfavoriteActions, mapState: mapfavoriteState } = createNamespacedHelpers('favorite')
export default {
  data () {
    return {
    }
  },
  components: {
    CardList
  },

  created () {
    this.getfavoritelist()
  },
  computed: {
    ...mapfavoriteState(['list'])
  },

  methods: {
    ...mapfavoriteActions(['getfavoritelist'])
    // async  getfavoriates () {
    //   const res = await favoriates()
    //   this.list = res.data.body
    // }
  },
  beforeDestroy () {

  }
}
</script>

<style scoped lang='less'>

</style>
